package com.agent;

import com.agent.util.AppUtil;
import lombok.extern.slf4j.Slf4j;
import java.lang.instrument.Instrumentation;

/**
 * 创建 Java Agent
 */
@Slf4j
public class MyAgent {
    public static void premain(String args, Instrumentation inst) {
        System.out.println("MyAgent连接成功......");
        System.out.println("自定义参数:"+args);
        System.out.println("应用名称:"+ AppUtil.getAppName());
        System.out.println("服务IP:"+ AppUtil.serverIp());
        inst.addTransformer(new MonitoringTransformer());
    }
}